package com.wsh.study.model;


import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@ToString
@Document(indexName = "farmer", type = "DataHistory")
public class DataHistoryESModel implements Serializable {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 项目id
     */
    @Field(type = FieldType.Long)
    private Long projectId;

    /**
     * 模块id
     */
    @Field(type = FieldType.Long)
    private Long moduleId;

    /**
     * 采集器id
     */
    @Field(type = FieldType.Long)
    private Long collectionId;

    /**
     * 数据节点id
     */
    @Field(type = FieldType.Long)
    private Long dataNodeId;

    /**
     * 数据指标
     */
    @Field(type = FieldType.Text)
    private String dataValue;

    /**
     * 数据指标
     */
    @Field(type = FieldType.Double)
    private Double dataDoubleValue;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date)
    private String createTime;

    /**
     * 数据类型 1: 正常数据 2:报警数据
     */
    @Field(type = FieldType.Integer)
    private Integer dataType;

    /**
     * 数据类型 1: 正常数据 2:报警数据
     */
    @Field(type = FieldType.Long)
    private Long triggerId;

    @Field(type = FieldType.Text)
    private String expressionText;
}

